﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LosConn.Web.Product
{
    public partial class ProductUpdate : BasePage.AdminBasePage
    {
        public String productNumber = String.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BindProType();
                Int32 Product_ID = Convert.ToInt32(Request.QueryString["id"]);
                Model.Los_Product model = new BLL.Los_Product().GetModel(Product_ID);
                Product_Code.Value = model.Product_Code;
                Product_Name.Value = model.Product_Name;
                Product_Price.Value = model.Product_Price.ToString();
                Product_Specification.Value = model.Product_Specification;
                Product_TypeName.Value = model.Product_TypeName;
                Product_Unit.Value = model.Product_Unit;
                Product_TypeID.Value = model.Product_TypeID.ToString();
                productNumber = model.Product_Number.ToString();
            }
        }

        private void BindProType()
        {
            Product_TypeID.DataSource = new BLL.Los_Type().GetList(" Type_Status=100 ");
            Product_TypeID.DataTextField = "Type_Name";
            Product_TypeID.DataValueField = "Type_ID";
            Product_TypeID.DataBind();
        }
    }
}